package com.playball.lottery.util;

import java.math.BigDecimal;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;

import com.playball.lottery.customview.ChildDTO;


/**
 * 奖金预测计算注数，最小最大奖金相关工具类,竞彩足球让球胜平负，胜平负，竞彩篮球胜负，让分胜负，大小分，北单奖金预测使用.除竞彩足球半全场，总进球，比分,竞彩篮球胜分差以外，混合投注以外
 * 
 * @author Administrator
 * 
 */
public class JCUtil {
	
	/**
	 * 按赛事mid进行升序排序
	 * @param list 待排序列表
	 * @return 排序后list
	 */
	public static List<Map<String, Object>> SortListData(List<Map<String, Object>> list) {

		if (!list.isEmpty()) {
			Collections.sort(list, new Comparator<Map<String, Object>>() {
				@Override
				public int compare(Map<String, Object> object1, Map<String, Object> object2) {
					int result = 0;
					// 升序
					if (Long.parseLong(String.valueOf(object1.get("IssueNo"))) > Long.parseLong(String.valueOf(object2.get("IssueNo")))) {
						result = 1;
						// result = 0;
					} else if (Long.parseLong(String.valueOf(object1.get("IssueNo"))) == Long.parseLong(String.valueOf(object2.get("IssueNo")))) {
						result = 0;
						// result = 1;
					} else {
						result = -1;
					}
					return result;
				}
			});
		}
		return list;
	}
	
	
	/**
	 * 将sp格式从sp= 0,1.65/3,1.84/ sp= 3,1.86/转为0/3/ 3/
	 * 
	 * @param str_sp
	 *            0,1.65/3,1.84/
	 * @return 0/3/
	 */
	public static String zhuanHuanSPGeShi(String str_sp) {
//		// Log.v("JCUtil ", "str_sp= "+str_sp.toString());
//		String[] attrs = str_sp.split("\\/");
//		String sp1 = attrs[0];
//		// Log.i("JCUtil ", "attrs.length= "+attrs.length);//2 ,1
//		String[] arr1 = sp1.split(",");
//		String id1 = arr1[0] + "/";
//		if (attrs.length == 1) {
//			str_sp = id1;
//		} else if (attrs.length == 2) {
//			String sp2 = attrs[1];
//			String[] arr2 = sp2.split(",");
//			String id2 = arr2[0] + "/";
//			str_sp = id1 + id2;
//		} else if (attrs.length == 3) {
//			String sp2 = attrs[1];
//			String[] arr2 = sp2.split(",");
//			String id2 = arr2[0] + "/";
//
//			String sp3 = attrs[2];
//			String[] arr3 = sp3.split(",");
//			String id3 = arr3[0] + "/";
//			str_sp = id1 + id2 + id3;
//		}
//		// Log.i("JCUtil ", "after str_sp= "+str_sp.toString());//2 ,1
//		return str_sp;
		
		String[] temp1 = str_sp.split("\\/");
		String res = "";
		for(String s:temp1){
			if(s.length()>3){
				res+=((s.split(","))[0]+"/");
			}
		}
		return res;
		
	}
	
	/**
	 * 获取一列中最大sp值
	 * 
	 * @param sp
	 * @return
	 */
	public static String getTeamMaxSP(String sp) {
		String spa;
		String spb;
		String spc;
		String max = null;
		// 将sp格式从sp= 0,1.65/3,1.84/ sp= 3,1.86/转为0/3/ 3/
		String[] attrs = sp.split("\\/");
		String[] arr1 = attrs[0].split(",");
		spa = arr1[1];
		if (attrs.length == 1) {
			max = spa;
		} else if (attrs.length == 2) {
			max = spa;
			String[] arr2 = attrs[1].split(",");
			spb = arr2[1];
			BigDecimal bdmax = new BigDecimal(max);
			BigDecimal bdspb = new BigDecimal(spb);
			if (bdspb.compareTo(bdmax) == 1) {// b>max
				max = spb;
			}
		} else if (attrs.length == 3) {
			max = spa;
			String[] arr2 = attrs[1].split(",");
			spb = arr2[1];
			BigDecimal bdmax = new BigDecimal(max);
			BigDecimal bdspb = new BigDecimal(spb);
			if (bdspb.compareTo(bdmax) == 1) {// b>max
				max = spb;
			}
			String[] arr3 = attrs[2].split(",");
			spc = arr3[1];
			BigDecimal bdmax3 = new BigDecimal(max);
			BigDecimal bdspc = new BigDecimal(spc);
			if (bdspc.compareTo(bdmax3) == 1) {// c>max
				max = spc;
			}
		} else if (attrs.length == 4) {
			max = spa;
			String[] arr2 = attrs[1].split(",");
			spb = arr2[1];
			BigDecimal bdmax = new BigDecimal(max);
			BigDecimal bdspb = new BigDecimal(spb);
			if (bdspb.compareTo(bdmax) == 1) {// b>max
				max = spb;
			}
			String[] arr3 = attrs[2].split(",");
			spc = arr3[1];
			BigDecimal bdmax3 = new BigDecimal(max);
			BigDecimal bdspc = new BigDecimal(spc);
			if (bdspc.compareTo(bdmax3) == 1) {// c>max
				max = spc;
			}
			String[] arr4 = attrs[3].split(",");
			spc = arr4[1];
			BigDecimal bdmax4 = new BigDecimal(max);
			BigDecimal bdspd = new BigDecimal(spc);
			if (bdspd.compareTo(bdmax4) == 1) {// c>max
				max = spc;
			}
		}
		return max;
	}

	/**
	 * 获取一列中最小sp值
	 * 
	 * @param sp
	 * @return
	 */
	public static String getTeamMinSP(String sp) {
		String spa;
		String spb;
		String spc;
		String min = null;
		// 将sp格式从sp= 0,1.65/3,1.84/ sp= 3,1.86/转为0/3/ 3/
		String[] attrs = sp.split("\\/");
		String[] arr1 = attrs[0].split(",");
		spa = arr1[1];
		if (attrs.length == 1) {
			min = spa;
		} else if (attrs.length == 2) {
			min = spa;
			String[] arr2 = attrs[1].split(",");
			spb = arr2[1];
			BigDecimal bdmin = new BigDecimal(min);
			BigDecimal bdspb = new BigDecimal(spb);
			if (bdspb.compareTo(bdmin) == -1) {
				min = spb;
			}
		} else if (attrs.length == 3) {
			min = spa;
			String[] arr2 = attrs[1].split(",");
			spb = arr2[1];
			BigDecimal bdmin = new BigDecimal(min);
			BigDecimal bdspb = new BigDecimal(spb);
			if (bdspb.compareTo(bdmin) == -1) {
				min = spb;
			}
			String[] arr3 = attrs[2].split(",");
			spc = arr3[1];
			BigDecimal bdmin3 = new BigDecimal(min);
			BigDecimal bdspc = new BigDecimal(spc);
			if (bdspc.compareTo(bdmin3) == -1) {
				min = spc;
			}
		} else if (attrs.length == 4) {
			min = spa;
			String[] arr2 = attrs[1].split(",");
			spb = arr2[1];
			BigDecimal bdmin = new BigDecimal(min);
			BigDecimal bdspb = new BigDecimal(spb);
			if (bdspb.compareTo(bdmin) == -1) {
				min = spb;
			}
			String[] arr3 = attrs[2].split(",");
			spc = arr3[1];
			BigDecimal bdmin3 = new BigDecimal(min);
			BigDecimal bdspc = new BigDecimal(spc);
			if (bdspc.compareTo(bdmin3) == -1) {
				min = spc;
			}
			String[] arr4 = attrs[3].split(",");
			spc = arr4[1];
			BigDecimal bdmin4 = new BigDecimal(min);
			BigDecimal bdspd = new BigDecimal(spc);
			if (bdspd.compareTo(bdmin4) == -1) {
				min = spc;
			}
		}
		return min;
	}

	/**
	 * 获取一列中注数
	 * 
	 * @param sp
	 * @return
	 */
	public static int getTeamCount(String sp) {
		int c = 0;
		sp = zhuanHuanSPGeShi(sp);
		if (sp.contains("3")) {
			c++;
		}
		if (sp.contains("0")) {
			c++;
		}
		if (sp.contains("1")) {
			c++;
		}		
		if (sp.contains("4")) {//下双 使用      北单 上下单双共用,3 1 0分别对应北单 上单 上双 下单
			c++;
		}
		return c;
	}

	/**
	 * 计算注数，最小奖金，最大奖金
	 * 
	 * @param num
	 * @param list
	 * @return 注数|最小奖金|最大奖金
	 */
	public static String getMatchCount(int num, List<ChildDTO> list) {
		String result;
		long c = 0;
		BigDecimal bdmaxM = new BigDecimal("0");
		BigDecimal bdminM = new BigDecimal("0");
		
		if (num == 1) {
			boolean isFirst = true;
			for (int i = 0; i < list.size(); ++i) {
				ChildDTO child = new ChildDTO();
				child = list.get(i);
				c =c+ getTeamCount(child.getStr_sp());
//				Log.v("getMatchCount", "c= " + c);
				BigDecimal bda = new BigDecimal(getTeamMaxSP(child.getStr_sp()));
				bdmaxM=bdmaxM.add(bda);
				BigDecimal bdtemp = new BigDecimal(getTeamMinSP(child.getStr_sp()));
				if (isFirst) {
					bdminM = new BigDecimal(getTeamMinSP(list.get(0).getStr_sp()));
					isFirst = false;
				}
				if (bdtemp.compareTo(bdminM) == -1 || bdtemp.compareTo(bdminM) == 0) {
					bdminM = bdtemp;
				}
			}
		}else if (num == 2) {
			boolean isFirst = true;
			for (int i = 0; i < list.size(); ++i) {
				ChildDTO child = new ChildDTO();
				child = list.get(i);
				int num1 = getTeamCount(child.getStr_sp());
				BigDecimal bda1 = new BigDecimal(getTeamMaxSP(child.getStr_sp()));
				BigDecimal bdi1 = new BigDecimal(getTeamMinSP(child.getStr_sp()));
				for (int j = i + 1; j < list.size(); ++j) {
					ChildDTO child2 = new ChildDTO();
					child2 = list.get(j);
					int num2 = getTeamCount(child2.getStr_sp());
					BigDecimal bda2 = new BigDecimal(getTeamMaxSP(child2.getStr_sp()));
					BigDecimal bdi2 = new BigDecimal(getTeamMinSP(child2.getStr_sp()));
					c += num1 * num2;
					bdmaxM = bdmaxM.add(bda1.multiply(bda2));// maxM += max1 *
																// max2;
					BigDecimal bdtemp = bdi1.multiply(bdi2);
					if (isFirst) {
						BigDecimal i0 = new BigDecimal(getTeamMinSP(list.get(0).getStr_sp()));
						BigDecimal i1 = new BigDecimal(getTeamMinSP(list.get(1).getStr_sp()));
						bdminM = i0.multiply(i1);
						isFirst = false;
					}
					if (bdtemp.compareTo(bdminM) == -1 || bdtemp.compareTo(bdminM) == 0) {
						bdminM = bdtemp;
					}
				}
			}
		} else if (num == 3) {
			boolean isFirst = true;
			for (int i = 0; i < list.size(); ++i) {
				ChildDTO child = new ChildDTO();
				child = list.get(i);
				int num1 = getTeamCount(child.getStr_sp());
				BigDecimal bda1 = new BigDecimal(getTeamMaxSP(child.getStr_sp()));
				BigDecimal bdi1 = new BigDecimal(getTeamMinSP(child.getStr_sp()));
				for (int j = i + 1; j < list.size(); ++j) {
					ChildDTO child2 = new ChildDTO();
					child2 = list.get(j);
					int num2 = getTeamCount(child2.getStr_sp());
					BigDecimal bda2 = new BigDecimal(getTeamMaxSP(child2.getStr_sp()));
					BigDecimal bdi2 = new BigDecimal(getTeamMinSP(child2.getStr_sp()));
					for (int k = j + 1; k < list.size(); ++k) {
						ChildDTO child3 = new ChildDTO();
						child3 = list.get(k);
						int num3 = getTeamCount(child3.getStr_sp());
						BigDecimal bda3 = new BigDecimal(getTeamMaxSP(child3.getStr_sp()));
						BigDecimal bdi3 = new BigDecimal(getTeamMinSP(child3.getStr_sp()));

						c += num1 * num2 * num3;
						bdmaxM = bdmaxM.add(bda1.multiply(bda2).multiply(bda3));
						BigDecimal bdtemp = bdi1.multiply(bdi2).multiply(bdi3);
						if (isFirst) {
							BigDecimal i0 = new BigDecimal(getTeamMinSP(list.get(0).getStr_sp()));
							BigDecimal i1 = new BigDecimal(getTeamMinSP(list.get(1).getStr_sp()));
							BigDecimal i2 = new BigDecimal(getTeamMinSP(list.get(2).getStr_sp()));
							bdminM = i0.multiply(i1).multiply(i2);
							isFirst = false;
						}
						if (bdtemp.compareTo(bdminM) == -1 || bdtemp.compareTo(bdminM) == 0) {
							bdminM = bdtemp;
						}
					}
				}
			}
		} else if (num == 4) {
			boolean isFirst = true;
			for (int i = 0; i < list.size(); ++i) {

				ChildDTO child = new ChildDTO();
				child = list.get(i);
				int num1 = getTeamCount(child.getStr_sp());
				BigDecimal bda1 = new BigDecimal(getTeamMaxSP(child.getStr_sp()));
				BigDecimal bdi1 = new BigDecimal(getTeamMinSP(child.getStr_sp()));
				for (int j = i + 1; j < list.size(); ++j) {
					ChildDTO child2 = new ChildDTO();
					child2 = list.get(j);
					int num2 = getTeamCount(child2.getStr_sp());
					BigDecimal bda2 = new BigDecimal(getTeamMaxSP(child2.getStr_sp()));
					BigDecimal bdi2 = new BigDecimal(getTeamMinSP(child2.getStr_sp()));
					for (int k = j + 1; k < list.size(); ++k) {
						ChildDTO child3 = new ChildDTO();
						child3 = list.get(k);
						int num3 = getTeamCount(child3.getStr_sp());
						BigDecimal bda3 = new BigDecimal(getTeamMaxSP(child3.getStr_sp()));
						BigDecimal bdi3 = new BigDecimal(getTeamMinSP(child3.getStr_sp()));
						for (int m = k + 1; m < list.size(); ++m) {
							ChildDTO child4 = new ChildDTO();
							child4 = list.get(m);
							int num4 = getTeamCount(child4.getStr_sp());
							BigDecimal bda4 = new BigDecimal(getTeamMaxSP(child4.getStr_sp()));
							BigDecimal bdi4 = new BigDecimal(getTeamMinSP(child4.getStr_sp()));
							c += num1 * num2 * num3 * num4;
							bdmaxM = bdmaxM.add(bda1.multiply(bda2).multiply(bda3).multiply(bda4));
							BigDecimal bdtemp = bdi1.multiply(bdi2).multiply(bdi3).multiply(bdi4);
							if (isFirst) {
								BigDecimal i0 = new BigDecimal(getTeamMinSP(list.get(0).getStr_sp()));
								BigDecimal i1 = new BigDecimal(getTeamMinSP(list.get(1).getStr_sp()));
								BigDecimal i2 = new BigDecimal(getTeamMinSP(list.get(2).getStr_sp()));
								BigDecimal i3 = new BigDecimal(getTeamMinSP(list.get(3).getStr_sp()));
								bdminM = i0.multiply(i1).multiply(i2).multiply(i3);
								isFirst = false;
							}
							if (bdtemp.compareTo(bdminM) == -1 || bdtemp.compareTo(bdminM) == 0) {
								bdminM = bdtemp;
							}
						}
					}
				}
			}
		} else if (num == 5) {
			boolean isFirst = true;
			for (int i = 0; i < list.size(); ++i) {

				ChildDTO child = new ChildDTO();
				child = list.get(i);
				int num1 = getTeamCount(child.getStr_sp());
				BigDecimal bda1 = new BigDecimal(getTeamMaxSP(child.getStr_sp()));
				BigDecimal bdi1 = new BigDecimal(getTeamMinSP(child.getStr_sp()));
				for (int j = i + 1; j < list.size(); ++j) {
					ChildDTO child2 = new ChildDTO();
					child2 = list.get(j);
					int num2 = getTeamCount(child2.getStr_sp());
					BigDecimal bda2 = new BigDecimal(getTeamMaxSP(child2.getStr_sp()));
					BigDecimal bdi2 = new BigDecimal(getTeamMinSP(child2.getStr_sp()));
					for (int k = j + 1; k < list.size(); ++k) {
						ChildDTO child3 = new ChildDTO();
						child3 = list.get(k);
						int num3 = getTeamCount(child3.getStr_sp());
						BigDecimal bda3 = new BigDecimal(getTeamMaxSP(child3.getStr_sp()));
						BigDecimal bdi3 = new BigDecimal(getTeamMinSP(child3.getStr_sp()));
						for (int m = k + 1; m < list.size(); ++m) {
							ChildDTO child4 = new ChildDTO();
							child4 = list.get(m);
							int num4 = getTeamCount(child4.getStr_sp());
							BigDecimal bda4 = new BigDecimal(getTeamMaxSP(child4.getStr_sp()));
							BigDecimal bdi4 = new BigDecimal(getTeamMinSP(child4.getStr_sp()));
							for (int n = m + 1; n < list.size(); ++n) {
								ChildDTO child5 = new ChildDTO();
								child5 = list.get(n);
								int num5 = getTeamCount(child5.getStr_sp());
								BigDecimal bda5 = new BigDecimal(getTeamMaxSP(child5.getStr_sp()));
								BigDecimal bdi5 = new BigDecimal(getTeamMinSP(child5.getStr_sp()));
								c += num1 * num2 * num3 * num4 * num5;
								bdmaxM = bdmaxM.add(bda1.multiply(bda2).multiply(bda3).multiply(bda4).multiply(bda5));
								BigDecimal bdtemp = bdi1.multiply(bdi2).multiply(bdi3).multiply(bdi4).multiply(bdi5);
								if (isFirst) {
									BigDecimal i0 = new BigDecimal(getTeamMinSP(list.get(0).getStr_sp()));
									BigDecimal i1 = new BigDecimal(getTeamMinSP(list.get(1).getStr_sp()));
									BigDecimal i2 = new BigDecimal(getTeamMinSP(list.get(2).getStr_sp()));
									BigDecimal i3 = new BigDecimal(getTeamMinSP(list.get(3).getStr_sp()));
									BigDecimal i4 = new BigDecimal(getTeamMinSP(list.get(4).getStr_sp()));
									bdminM = i0.multiply(i1).multiply(i2).multiply(i3).multiply(i4);
									isFirst = false;
								}
								if (bdtemp.compareTo(bdminM) == -1 || bdtemp.compareTo(bdminM) == 0) {
									bdminM = bdtemp;
								}
							}
						}
					}
				}
			}
		} else if (num == 6) {
			boolean isFirst = true;
			for (int i = 0; i < list.size(); ++i) {
				ChildDTO child = new ChildDTO();
				child = list.get(i);
				int num1 = getTeamCount(child.getStr_sp());
				BigDecimal bda1 = new BigDecimal(getTeamMaxSP(child.getStr_sp()));
				BigDecimal bdi1 = new BigDecimal(getTeamMinSP(child.getStr_sp()));
				for (int j = i + 1; j < list.size(); ++j) {
					ChildDTO child2 = new ChildDTO();
					child2 = list.get(j);
					int num2 = getTeamCount(child2.getStr_sp());
					BigDecimal bda2 = new BigDecimal(getTeamMaxSP(child2.getStr_sp()));
					BigDecimal bdi2 = new BigDecimal(getTeamMinSP(child2.getStr_sp()));
					for (int k = j + 1; k < list.size(); ++k) {
						ChildDTO child3 = new ChildDTO();
						child3 = list.get(k);
						int num3 = getTeamCount(child3.getStr_sp());
						BigDecimal bda3 = new BigDecimal(getTeamMaxSP(child3.getStr_sp()));
						BigDecimal bdi3 = new BigDecimal(getTeamMinSP(child3.getStr_sp()));
						for (int m = k + 1; m < list.size(); ++m) {
							ChildDTO child4 = new ChildDTO();
							child4 = list.get(m);
							int num4 = getTeamCount(child4.getStr_sp());
							BigDecimal bda4 = new BigDecimal(getTeamMaxSP(child4.getStr_sp()));
							BigDecimal bdi4 = new BigDecimal(getTeamMinSP(child4.getStr_sp()));
							for (int n = m + 1; n < list.size(); ++n) {
								ChildDTO child5 = new ChildDTO();
								child5 = list.get(n);
								int num5 = getTeamCount(child5.getStr_sp());
								BigDecimal bda5 = new BigDecimal(getTeamMaxSP(child5.getStr_sp()));
								BigDecimal bdi5 = new BigDecimal(getTeamMinSP(child5.getStr_sp()));
								for (int o = n + 1; o < list.size(); ++o) {
									ChildDTO child6 = new ChildDTO();
									child6 = list.get(o);
									int num6 = getTeamCount(child6.getStr_sp());
									BigDecimal bda6 = new BigDecimal(getTeamMaxSP(child6.getStr_sp()));
									BigDecimal bdi6 = new BigDecimal(getTeamMinSP(child6.getStr_sp()));
									c += num1 * num2 * num3 * num4 * num5 * num6;
									bdmaxM = bdmaxM.add(bda1.multiply(bda2).multiply(bda3).multiply(bda4).multiply(bda5).multiply(bda6));
									BigDecimal bdtemp = bdi1.multiply(bdi2).multiply(bdi3).multiply(bdi4).multiply(bdi5).multiply(bdi6);
									if (isFirst) {
										BigDecimal i0 = new BigDecimal(getTeamMinSP(list.get(0).getStr_sp()));
										BigDecimal i1 = new BigDecimal(getTeamMinSP(list.get(1).getStr_sp()));
										BigDecimal i2 = new BigDecimal(getTeamMinSP(list.get(2).getStr_sp()));
										BigDecimal i3 = new BigDecimal(getTeamMinSP(list.get(3).getStr_sp()));
										BigDecimal i4 = new BigDecimal(getTeamMinSP(list.get(4).getStr_sp()));
										BigDecimal i5 = new BigDecimal(getTeamMinSP(list.get(5).getStr_sp()));
										bdminM = i0.multiply(i1).multiply(i2).multiply(i3).multiply(i4).multiply(i5);
										isFirst = false;
									}
									if (bdtemp.compareTo(bdminM) == -1 || bdtemp.compareTo(bdminM) == 0) {
										bdminM = bdtemp;
									}
								}
							}
						}
					}
				}
			}
		} else if (num == 7) {
			boolean isFirst = true;
			for (int i = 0; i < list.size(); ++i) {
				ChildDTO child = new ChildDTO();
				child = list.get(i);
				int num1 = getTeamCount(child.getStr_sp());
				BigDecimal bda1 = new BigDecimal(getTeamMaxSP(child.getStr_sp()));
				BigDecimal bdi1 = new BigDecimal(getTeamMinSP(child.getStr_sp()));
				for (int j = i + 1; j < list.size(); ++j) {
					ChildDTO child2 = new ChildDTO();
					child2 = list.get(j);
					int num2 = getTeamCount(child2.getStr_sp());
					BigDecimal bda2 = new BigDecimal(getTeamMaxSP(child2.getStr_sp()));
					BigDecimal bdi2 = new BigDecimal(getTeamMinSP(child2.getStr_sp()));
					for (int k = j + 1; k < list.size(); ++k) {
						ChildDTO child3 = new ChildDTO();
						child3 = list.get(k);
						int num3 = getTeamCount(child3.getStr_sp());
						BigDecimal bda3 = new BigDecimal(getTeamMaxSP(child3.getStr_sp()));
						BigDecimal bdi3 = new BigDecimal(getTeamMinSP(child3.getStr_sp()));
						for (int m = k + 1; m < list.size(); ++m) {
							ChildDTO child4 = new ChildDTO();
							child4 = list.get(m);
							int num4 = getTeamCount(child4.getStr_sp());
							BigDecimal bda4 = new BigDecimal(getTeamMaxSP(child4.getStr_sp()));
							BigDecimal bdi4 = new BigDecimal(getTeamMinSP(child4.getStr_sp()));
							for (int n = m + 1; n < list.size(); ++n) {
								ChildDTO child5 = new ChildDTO();
								child5 = list.get(n);
								int num5 = getTeamCount(child5.getStr_sp());
								BigDecimal bda5 = new BigDecimal(getTeamMaxSP(child5.getStr_sp()));
								BigDecimal bdi5 = new BigDecimal(getTeamMinSP(child5.getStr_sp()));
								for (int o = n + 1; o < list.size(); ++o) {
									ChildDTO child6 = new ChildDTO();
									child6 = list.get(o);
									int num6 = getTeamCount(child6.getStr_sp());
									BigDecimal bda6 = new BigDecimal(getTeamMaxSP(child6.getStr_sp()));
									BigDecimal bdi6 = new BigDecimal(getTeamMinSP(child6.getStr_sp()));
									for (int p = o + 1; p < list.size(); ++p) {
										ChildDTO child7 = new ChildDTO();
										child7 = list.get(p);
										int num7 = getTeamCount(child7.getStr_sp());
										BigDecimal bda7 = new BigDecimal(getTeamMaxSP(child7.getStr_sp()));
										BigDecimal bdi7 = new BigDecimal(getTeamMinSP(child7.getStr_sp()));
										c += num1 * num2 * num3 * num4 * num5 * num6 * num7;
										bdmaxM = bdmaxM.add(bda1.multiply(bda2).multiply(bda3).multiply(bda4).multiply(bda5).multiply(bda6).multiply(bda7));
										BigDecimal bdtemp = bdi1.multiply(bdi2).multiply(bdi3).multiply(bdi4).multiply(bdi5).multiply(bdi6).multiply(bdi7);
										if (isFirst) {
											BigDecimal i0 = new BigDecimal(getTeamMinSP(list.get(0).getStr_sp()));
											BigDecimal i1 = new BigDecimal(getTeamMinSP(list.get(1).getStr_sp()));
											BigDecimal i2 = new BigDecimal(getTeamMinSP(list.get(2).getStr_sp()));
											BigDecimal i3 = new BigDecimal(getTeamMinSP(list.get(3).getStr_sp()));
											BigDecimal i4 = new BigDecimal(getTeamMinSP(list.get(4).getStr_sp()));
											BigDecimal i5 = new BigDecimal(getTeamMinSP(list.get(5).getStr_sp()));
											BigDecimal i6 = new BigDecimal(getTeamMinSP(list.get(6).getStr_sp()));
											bdminM = i0.multiply(i1).multiply(i2).multiply(i3).multiply(i4).multiply(i5).multiply(i6);
											isFirst = false;
										}
										if (bdtemp.compareTo(bdminM) == -1 || bdtemp.compareTo(bdminM) == 0) {
											bdminM = bdtemp;
										}
									}
								}
							}
						}
					}
				}
			}
		} else if (num == 8) {
			boolean isFirst = true;
			for (int i = 0; i < list.size(); ++i) {
				ChildDTO child = new ChildDTO();
				child = list.get(i);
				int num1 = getTeamCount(child.getStr_sp());
				BigDecimal bda1 = new BigDecimal(getTeamMaxSP(child.getStr_sp()));
				BigDecimal bdi1 = new BigDecimal(getTeamMinSP(child.getStr_sp()));
				for (int j = i + 1; j < list.size(); ++j) {
					ChildDTO child2 = new ChildDTO();
					child2 = list.get(j);
					int num2 = getTeamCount(child2.getStr_sp());
					BigDecimal bda2 = new BigDecimal(getTeamMaxSP(child2.getStr_sp()));
					BigDecimal bdi2 = new BigDecimal(getTeamMinSP(child2.getStr_sp()));
					for (int k = j + 1; k < list.size(); ++k) {
						ChildDTO child3 = new ChildDTO();
						child3 = list.get(k);
						int num3 = getTeamCount(child3.getStr_sp());
						BigDecimal bda3 = new BigDecimal(getTeamMaxSP(child3.getStr_sp()));
						BigDecimal bdi3 = new BigDecimal(getTeamMinSP(child3.getStr_sp()));
						for (int m = k + 1; m < list.size(); ++m) {
							ChildDTO child4 = new ChildDTO();
							child4 = list.get(m);
							int num4 = getTeamCount(child4.getStr_sp());
							BigDecimal bda4 = new BigDecimal(getTeamMaxSP(child4.getStr_sp()));
							BigDecimal bdi4 = new BigDecimal(getTeamMinSP(child4.getStr_sp()));
							for (int n = m + 1; n < list.size(); ++n) {
								ChildDTO child5 = new ChildDTO();
								child5 = list.get(n);
								int num5 = getTeamCount(child5.getStr_sp());
								BigDecimal bda5 = new BigDecimal(getTeamMaxSP(child5.getStr_sp()));
								BigDecimal bdi5 = new BigDecimal(getTeamMinSP(child5.getStr_sp()));
								for (int o = n + 1; o < list.size(); ++o) {
									ChildDTO child6 = new ChildDTO();
									child6 = list.get(o);
									int num6 = getTeamCount(child6.getStr_sp());
									BigDecimal bda6 = new BigDecimal(getTeamMaxSP(child6.getStr_sp()));
									BigDecimal bdi6 = new BigDecimal(getTeamMinSP(child6.getStr_sp()));
									for (int p = o + 1; p < list.size(); ++p) {
										ChildDTO child7 = new ChildDTO();
										child7 = list.get(p);
										int num7 = getTeamCount(child7.getStr_sp());
										BigDecimal bda7 = new BigDecimal(getTeamMaxSP(child7.getStr_sp()));
										BigDecimal bdi7 = new BigDecimal(getTeamMinSP(child7.getStr_sp()));
										for (int q = p + 1; q < list.size(); ++q) {
											ChildDTO child8 = new ChildDTO();
											child8 = list.get(q);
											int num8 = getTeamCount(child8.getStr_sp());
											BigDecimal bda8 = new BigDecimal(getTeamMaxSP(child8.getStr_sp()));
											BigDecimal bdi8 = new BigDecimal(getTeamMinSP(child8.getStr_sp()));
											c += num1 * num2 * num3 * num4 * num5 * num6 * num7 * num8;
											bdmaxM = bdmaxM.add(bda1.multiply(bda2).multiply(bda3).multiply(bda4).multiply(bda5).multiply(bda6).multiply(bda7).multiply(bda8));
											BigDecimal bdtemp = bdi1.multiply(bdi2).multiply(bdi3).multiply(bdi4).multiply(bdi5).multiply(bdi6).multiply(bdi7).multiply(bdi8);
											if (isFirst) {
												BigDecimal i0 = new BigDecimal(getTeamMinSP(list.get(0).getStr_sp()));
												BigDecimal i1 = new BigDecimal(getTeamMinSP(list.get(1).getStr_sp()));
												BigDecimal i2 = new BigDecimal(getTeamMinSP(list.get(2).getStr_sp()));
												BigDecimal i3 = new BigDecimal(getTeamMinSP(list.get(3).getStr_sp()));
												BigDecimal i4 = new BigDecimal(getTeamMinSP(list.get(4).getStr_sp()));
												BigDecimal i5 = new BigDecimal(getTeamMinSP(list.get(5).getStr_sp()));
												BigDecimal i6 = new BigDecimal(getTeamMinSP(list.get(6).getStr_sp()));
												BigDecimal i7 = new BigDecimal(getTeamMinSP(list.get(7).getStr_sp()));
												bdminM = i0.multiply(i1).multiply(i2).multiply(i3).multiply(i4).multiply(i5).multiply(i6).multiply(i7);
												isFirst = false;
											}
											if (bdtemp.compareTo(bdminM) == -1 || bdtemp.compareTo(bdminM) == 0) {
												bdminM = bdtemp;
											}
										}
									}
								}
							}
						}
					}
				}
			}
		} else if (num == 9) {
			boolean isFirst = true;
			for (int i = 0; i < list.size(); ++i) {
				ChildDTO child = new ChildDTO();
				child = list.get(i);
				int num1 = getTeamCount(child.getStr_sp());
				BigDecimal bda1 = new BigDecimal(getTeamMaxSP(child.getStr_sp()));
				BigDecimal bdi1 = new BigDecimal(getTeamMinSP(child.getStr_sp()));
				for (int j = i + 1; j < list.size(); ++j) {
					ChildDTO child2 = new ChildDTO();
					child2 = list.get(j);
					int num2 = getTeamCount(child2.getStr_sp());
					BigDecimal bda2 = new BigDecimal(getTeamMaxSP(child2.getStr_sp()));
					BigDecimal bdi2 = new BigDecimal(getTeamMinSP(child2.getStr_sp()));
					for (int k = j + 1; k < list.size(); ++k) {
						ChildDTO child3 = new ChildDTO();
						child3 = list.get(k);
						int num3 = getTeamCount(child3.getStr_sp());
						BigDecimal bda3 = new BigDecimal(getTeamMaxSP(child3.getStr_sp()));
						BigDecimal bdi3 = new BigDecimal(getTeamMinSP(child3.getStr_sp()));
						for (int m = k + 1; m < list.size(); ++m) {
							ChildDTO child4 = new ChildDTO();
							child4 = list.get(m);
							int num4 = getTeamCount(child4.getStr_sp());
							BigDecimal bda4 = new BigDecimal(getTeamMaxSP(child4.getStr_sp()));
							BigDecimal bdi4 = new BigDecimal(getTeamMinSP(child4.getStr_sp()));
							for (int n = m + 1; n < list.size(); ++n) {
								ChildDTO child5 = new ChildDTO();
								child5 = list.get(n);
								int num5 = getTeamCount(child5.getStr_sp());
								BigDecimal bda5 = new BigDecimal(getTeamMaxSP(child5.getStr_sp()));
								BigDecimal bdi5 = new BigDecimal(getTeamMinSP(child5.getStr_sp()));
								for (int o = n + 1; o < list.size(); ++o) {
									ChildDTO child6 = new ChildDTO();
									child6 = list.get(o);
									int num6 = getTeamCount(child6.getStr_sp());
									BigDecimal bda6 = new BigDecimal(getTeamMaxSP(child6.getStr_sp()));
									BigDecimal bdi6 = new BigDecimal(getTeamMinSP(child6.getStr_sp()));
									for (int p = o + 1; p < list.size(); ++p) {
										ChildDTO child7 = new ChildDTO();
										child7 = list.get(p);
										int num7 = getTeamCount(child7.getStr_sp());
										BigDecimal bda7 = new BigDecimal(getTeamMaxSP(child7.getStr_sp()));
										BigDecimal bdi7 = new BigDecimal(getTeamMinSP(child7.getStr_sp()));
										for (int q = p + 1; q < list.size(); ++q) {
											ChildDTO child8 = new ChildDTO();
											child8 = list.get(q);
											int num8 = getTeamCount(child8.getStr_sp());
											BigDecimal bda8 = new BigDecimal(getTeamMaxSP(child8.getStr_sp()));
											BigDecimal bdi8 = new BigDecimal(getTeamMinSP(child8.getStr_sp()));
											for (int r = q + 1; r < list.size(); ++r) {
												ChildDTO child9 = new ChildDTO();
												child9 = list.get(r);
												int num9 = getTeamCount(child9.getStr_sp());
												BigDecimal bda9 = new BigDecimal(getTeamMaxSP(child9.getStr_sp()));
												BigDecimal bdi9 = new BigDecimal(getTeamMinSP(child9.getStr_sp()));
												c += num1 * num2 * num3 * num4 * num5 * num6 * num7 * num8 * num9;
												bdmaxM = bdmaxM.add(bda1.multiply(bda2).multiply(bda3).multiply(bda4).multiply(bda5).multiply(bda6).multiply(bda7).multiply(bda8).multiply(bda9));
												BigDecimal bdtemp = bdi1.multiply(bdi2).multiply(bdi3).multiply(bdi4).multiply(bdi5).multiply(bdi6).multiply(bdi7).multiply(bdi8).multiply(bdi9);
												if (isFirst) {
													BigDecimal i0 = new BigDecimal(getTeamMinSP(list.get(0).getStr_sp()));
													BigDecimal i1 = new BigDecimal(getTeamMinSP(list.get(1).getStr_sp()));
													BigDecimal i2 = new BigDecimal(getTeamMinSP(list.get(2).getStr_sp()));
													BigDecimal i3 = new BigDecimal(getTeamMinSP(list.get(3).getStr_sp()));
													BigDecimal i4 = new BigDecimal(getTeamMinSP(list.get(4).getStr_sp()));
													BigDecimal i5 = new BigDecimal(getTeamMinSP(list.get(5).getStr_sp()));
													BigDecimal i6 = new BigDecimal(getTeamMinSP(list.get(6).getStr_sp()));
													BigDecimal i7 = new BigDecimal(getTeamMinSP(list.get(7).getStr_sp()));
													BigDecimal i8 = new BigDecimal(getTeamMinSP(list.get(8).getStr_sp()));
													bdminM = i0.multiply(i1).multiply(i2).multiply(i3).multiply(i4).multiply(i5).multiply(i6).multiply(i7).multiply(i8);
													isFirst = false;
												}
												if (bdtemp.compareTo(bdminM) == -1 || bdtemp.compareTo(bdminM) == 0) {
													bdminM = bdtemp;
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		} else if (num == 10) {
			boolean isFirst = true;
			for (int i = 0; i < list.size(); ++i) {
				ChildDTO child = new ChildDTO();
				child = list.get(i);
				int num1 = getTeamCount(child.getStr_sp());
				BigDecimal bda1 = new BigDecimal(getTeamMaxSP(child.getStr_sp()));
				BigDecimal bdi1 = new BigDecimal(getTeamMinSP(child.getStr_sp()));
				for (int j = i + 1; j < list.size(); ++j) {
					ChildDTO child2 = new ChildDTO();
					child2 = list.get(j);
					int num2 = getTeamCount(child2.getStr_sp());
					BigDecimal bda2 = new BigDecimal(getTeamMaxSP(child2.getStr_sp()));
					BigDecimal bdi2 = new BigDecimal(getTeamMinSP(child2.getStr_sp()));
					for (int k = j + 1; k < list.size(); ++k) {
						ChildDTO child3 = new ChildDTO();
						child3 = list.get(k);
						int num3 = getTeamCount(child3.getStr_sp());
						BigDecimal bda3 = new BigDecimal(getTeamMaxSP(child3.getStr_sp()));
						BigDecimal bdi3 = new BigDecimal(getTeamMinSP(child3.getStr_sp()));
						for (int m = k + 1; m < list.size(); ++m) {
							ChildDTO child4 = new ChildDTO();
							child4 = list.get(m);
							int num4 = getTeamCount(child4.getStr_sp());
							BigDecimal bda4 = new BigDecimal(getTeamMaxSP(child4.getStr_sp()));
							BigDecimal bdi4 = new BigDecimal(getTeamMinSP(child4.getStr_sp()));
							for (int n = m + 1; n < list.size(); ++n) {
								ChildDTO child5 = new ChildDTO();
								child5 = list.get(n);
								int num5 = getTeamCount(child5.getStr_sp());
								BigDecimal bda5 = new BigDecimal(getTeamMaxSP(child5.getStr_sp()));
								BigDecimal bdi5 = new BigDecimal(getTeamMinSP(child5.getStr_sp()));
								for (int o = n + 1; o < list.size(); ++o) {
									ChildDTO child6 = new ChildDTO();
									child6 = list.get(o);
									int num6 = getTeamCount(child6.getStr_sp());
									BigDecimal bda6 = new BigDecimal(getTeamMaxSP(child6.getStr_sp()));
									BigDecimal bdi6 = new BigDecimal(getTeamMinSP(child6.getStr_sp()));
									for (int p = o + 1; p < list.size(); ++p) {
										ChildDTO child7 = new ChildDTO();
										child7 = list.get(p);
										int num7 = getTeamCount(child7.getStr_sp());
										BigDecimal bda7 = new BigDecimal(getTeamMaxSP(child7.getStr_sp()));
										BigDecimal bdi7 = new BigDecimal(getTeamMinSP(child7.getStr_sp()));
										for (int q = p + 1; q < list.size(); ++q) {
											ChildDTO child8 = new ChildDTO();
											child8 = list.get(q);
											int num8 = getTeamCount(child8.getStr_sp());
											BigDecimal bda8 = new BigDecimal(getTeamMaxSP(child8.getStr_sp()));
											BigDecimal bdi8 = new BigDecimal(getTeamMinSP(child8.getStr_sp()));
											for (int r = q + 1; r < list.size(); ++r) {
												ChildDTO child9 = new ChildDTO();
												child9 = list.get(r);
												int num9 = getTeamCount(child9.getStr_sp());
												BigDecimal bda9 = new BigDecimal(getTeamMaxSP(child9.getStr_sp()));
												BigDecimal bdi9 = new BigDecimal(getTeamMinSP(child9.getStr_sp()));
												for (int s = r + 1; s < list.size(); ++s) {
													ChildDTO child10 = new ChildDTO();
													child10 = list.get(s);
													int num10 = getTeamCount(child10.getStr_sp());
													BigDecimal bda10 = new BigDecimal(getTeamMaxSP(child10.getStr_sp()));
													BigDecimal bdi10 = new BigDecimal(getTeamMinSP(child10.getStr_sp()));
													c += num1 * num2 * num3 * num4 * num5 * num6 * num7 * num8 * num9 * num10;
													bdmaxM = bdmaxM.add(bda1.multiply(bda2).multiply(bda3).multiply(bda4).multiply(bda5).multiply(bda6).multiply(bda7).multiply(bda8).multiply(bda9)
															.multiply(bda10));
													BigDecimal bdtemp = bdi1.multiply(bdi2).multiply(bdi3).multiply(bdi4).multiply(bdi5).multiply(bdi6).multiply(bdi7).multiply(bdi8).multiply(bdi9)
															.multiply(bdi10);
													if (isFirst) {
														BigDecimal i0 = new BigDecimal(getTeamMinSP(list.get(0).getStr_sp()));
														BigDecimal i1 = new BigDecimal(getTeamMinSP(list.get(1).getStr_sp()));
														BigDecimal i2 = new BigDecimal(getTeamMinSP(list.get(2).getStr_sp()));
														BigDecimal i3 = new BigDecimal(getTeamMinSP(list.get(3).getStr_sp()));
														BigDecimal i4 = new BigDecimal(getTeamMinSP(list.get(4).getStr_sp()));
														BigDecimal i5 = new BigDecimal(getTeamMinSP(list.get(5).getStr_sp()));
														BigDecimal i6 = new BigDecimal(getTeamMinSP(list.get(6).getStr_sp()));
														BigDecimal i7 = new BigDecimal(getTeamMinSP(list.get(7).getStr_sp()));
														BigDecimal i8 = new BigDecimal(getTeamMinSP(list.get(8).getStr_sp()));
														BigDecimal i9 = new BigDecimal(getTeamMinSP(list.get(9).getStr_sp()));
														bdminM = i0.multiply(i1).multiply(i2).multiply(i3).multiply(i4).multiply(i5).multiply(i6).multiply(i7).multiply(i8).multiply(i9);
														isFirst = false;
													}
													if (bdtemp.compareTo(bdminM) == -1 || bdtemp.compareTo(bdminM) == 0) {
														bdminM = bdtemp;
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		} else if (num == 11) {
			boolean isFirst = true;
			for (int i = 0; i < list.size(); ++i) {
				ChildDTO child = new ChildDTO();
				child = list.get(i);
				int num1 = getTeamCount(child.getStr_sp());
				BigDecimal bda1 = new BigDecimal(getTeamMaxSP(child.getStr_sp()));
				BigDecimal bdi1 = new BigDecimal(getTeamMinSP(child.getStr_sp()));
				for (int j = i + 1; j < list.size(); ++j) {
					ChildDTO child2 = new ChildDTO();
					child2 = list.get(j);
					int num2 = getTeamCount(child2.getStr_sp());
					BigDecimal bda2 = new BigDecimal(getTeamMaxSP(child2.getStr_sp()));
					BigDecimal bdi2 = new BigDecimal(getTeamMinSP(child2.getStr_sp()));
					for (int k = j + 1; k < list.size(); ++k) {
						ChildDTO child3 = new ChildDTO();
						child3 = list.get(k);
						int num3 = getTeamCount(child3.getStr_sp());
						BigDecimal bda3 = new BigDecimal(getTeamMaxSP(child3.getStr_sp()));
						BigDecimal bdi3 = new BigDecimal(getTeamMinSP(child3.getStr_sp()));
						for (int m = k + 1; m < list.size(); ++m) {
							ChildDTO child4 = new ChildDTO();
							child4 = list.get(m);
							int num4 = getTeamCount(child4.getStr_sp());
							BigDecimal bda4 = new BigDecimal(getTeamMaxSP(child4.getStr_sp()));
							BigDecimal bdi4 = new BigDecimal(getTeamMinSP(child4.getStr_sp()));
							for (int n = m + 1; n < list.size(); ++n) {
								ChildDTO child5 = new ChildDTO();
								child5 = list.get(n);
								int num5 = getTeamCount(child5.getStr_sp());
								BigDecimal bda5 = new BigDecimal(getTeamMaxSP(child5.getStr_sp()));
								BigDecimal bdi5 = new BigDecimal(getTeamMinSP(child5.getStr_sp()));
								for (int o = n + 1; o < list.size(); ++o) {
									ChildDTO child6 = new ChildDTO();
									child6 = list.get(o);
									int num6 = getTeamCount(child6.getStr_sp());
									BigDecimal bda6 = new BigDecimal(getTeamMaxSP(child6.getStr_sp()));
									BigDecimal bdi6 = new BigDecimal(getTeamMinSP(child6.getStr_sp()));
									for (int p = o + 1; p < list.size(); ++p) {
										ChildDTO child7 = new ChildDTO();
										child7 = list.get(p);
										int num7 = getTeamCount(child7.getStr_sp());
										BigDecimal bda7 = new BigDecimal(getTeamMaxSP(child7.getStr_sp()));
										BigDecimal bdi7 = new BigDecimal(getTeamMinSP(child7.getStr_sp()));
										for (int q = p + 1; q < list.size(); ++q) {
											ChildDTO child8 = new ChildDTO();
											child8 = list.get(q);
											int num8 = getTeamCount(child8.getStr_sp());
											BigDecimal bda8 = new BigDecimal(getTeamMaxSP(child8.getStr_sp()));
											BigDecimal bdi8 = new BigDecimal(getTeamMinSP(child8.getStr_sp()));
											for (int r = q + 1; r < list.size(); ++r) {
												ChildDTO child9 = new ChildDTO();
												child9 = list.get(r);
												int num9 = getTeamCount(child9.getStr_sp());
												BigDecimal bda9 = new BigDecimal(getTeamMaxSP(child9.getStr_sp()));
												BigDecimal bdi9 = new BigDecimal(getTeamMinSP(child9.getStr_sp()));
												for (int s = r + 1; s < list.size(); ++s) {
													ChildDTO child10 = new ChildDTO();
													child10 = list.get(s);
													int num10 = getTeamCount(child10.getStr_sp());
													BigDecimal bda10 = new BigDecimal(getTeamMaxSP(child10.getStr_sp()));
													BigDecimal bdi10 = new BigDecimal(getTeamMinSP(child10.getStr_sp()));
													for (int t = s + 1; t < list.size(); ++t) {
														ChildDTO child11 = new ChildDTO();
														child11 = list.get(t);
														int num11 = getTeamCount(child11.getStr_sp());
														BigDecimal bda11 = new BigDecimal(getTeamMaxSP(child11.getStr_sp()));
														BigDecimal bdi11 = new BigDecimal(getTeamMinSP(child11.getStr_sp()));
														c += num1 * num2 * num3 * num4 * num5 * num6 * num7 * num8 * num9 * num10 * num11;
														bdmaxM = bdmaxM.add(bda1.multiply(bda2).multiply(bda3).multiply(bda4).multiply(bda5).multiply(bda6).multiply(bda7).multiply(bda8)
																.multiply(bda9).multiply(bda10).multiply(bda11));
														BigDecimal bdtemp = bdi1.multiply(bdi2).multiply(bdi3).multiply(bdi4).multiply(bdi5).multiply(bdi6).multiply(bdi7).multiply(bdi8)
																.multiply(bdi9).multiply(bdi10).multiply(bdi11);
														if (isFirst) {
															BigDecimal i0 = new BigDecimal(getTeamMinSP(list.get(0).getStr_sp()));
															BigDecimal i1 = new BigDecimal(getTeamMinSP(list.get(1).getStr_sp()));
															BigDecimal i2 = new BigDecimal(getTeamMinSP(list.get(2).getStr_sp()));
															BigDecimal i3 = new BigDecimal(getTeamMinSP(list.get(3).getStr_sp()));
															BigDecimal i4 = new BigDecimal(getTeamMinSP(list.get(4).getStr_sp()));
															BigDecimal i5 = new BigDecimal(getTeamMinSP(list.get(5).getStr_sp()));
															BigDecimal i6 = new BigDecimal(getTeamMinSP(list.get(6).getStr_sp()));
															BigDecimal i7 = new BigDecimal(getTeamMinSP(list.get(7).getStr_sp()));
															BigDecimal i8 = new BigDecimal(getTeamMinSP(list.get(8).getStr_sp()));
															BigDecimal i9 = new BigDecimal(getTeamMinSP(list.get(9).getStr_sp()));
															BigDecimal i10 = new BigDecimal(getTeamMinSP(list.get(10).getStr_sp()));
															bdminM = i0.multiply(i1).multiply(i2).multiply(i3).multiply(i4).multiply(i5).multiply(i6).multiply(i7).multiply(i8).multiply(i9)
																	.multiply(i10);
															isFirst = false;
														}
														if (bdtemp.compareTo(bdminM) == -1 || bdtemp.compareTo(bdminM) == 0) {
															bdminM = bdtemp;
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		} else if (num == 12) {
			boolean isFirst = true;
			for (int i = 0; i < list.size(); ++i) {
				ChildDTO child = new ChildDTO();
				child = list.get(i);
				int num1 = getTeamCount(child.getStr_sp());
				BigDecimal bda1 = new BigDecimal(getTeamMaxSP(child.getStr_sp()));
				BigDecimal bdi1 = new BigDecimal(getTeamMinSP(child.getStr_sp()));
				for (int j = i + 1; j < list.size(); ++j) {
					ChildDTO child2 = new ChildDTO();
					child2 = list.get(j);
					int num2 = getTeamCount(child2.getStr_sp());
					BigDecimal bda2 = new BigDecimal(getTeamMaxSP(child2.getStr_sp()));
					BigDecimal bdi2 = new BigDecimal(getTeamMinSP(child2.getStr_sp()));
					for (int k = j + 1; k < list.size(); ++k) {
						ChildDTO child3 = new ChildDTO();
						child3 = list.get(k);
						int num3 = getTeamCount(child3.getStr_sp());
						BigDecimal bda3 = new BigDecimal(getTeamMaxSP(child3.getStr_sp()));
						BigDecimal bdi3 = new BigDecimal(getTeamMinSP(child3.getStr_sp()));
						for (int m = k + 1; m < list.size(); ++m) {
							ChildDTO child4 = new ChildDTO();
							child4 = list.get(m);
							int num4 = getTeamCount(child4.getStr_sp());
							BigDecimal bda4 = new BigDecimal(getTeamMaxSP(child4.getStr_sp()));
							BigDecimal bdi4 = new BigDecimal(getTeamMinSP(child4.getStr_sp()));
							for (int n = m + 1; n < list.size(); ++n) {
								ChildDTO child5 = new ChildDTO();
								child5 = list.get(n);
								int num5 = getTeamCount(child5.getStr_sp());
								BigDecimal bda5 = new BigDecimal(getTeamMaxSP(child5.getStr_sp()));
								BigDecimal bdi5 = new BigDecimal(getTeamMinSP(child5.getStr_sp()));
								for (int o = n + 1; o < list.size(); ++o) {
									ChildDTO child6 = new ChildDTO();
									child6 = list.get(o);
									int num6 = getTeamCount(child6.getStr_sp());
									BigDecimal bda6 = new BigDecimal(getTeamMaxSP(child6.getStr_sp()));
									BigDecimal bdi6 = new BigDecimal(getTeamMinSP(child6.getStr_sp()));
									for (int p = o + 1; p < list.size(); ++p) {
										ChildDTO child7 = new ChildDTO();
										child7 = list.get(p);
										int num7 = getTeamCount(child7.getStr_sp());
										BigDecimal bda7 = new BigDecimal(getTeamMaxSP(child7.getStr_sp()));
										BigDecimal bdi7 = new BigDecimal(getTeamMinSP(child7.getStr_sp()));
										for (int q = p + 1; q < list.size(); ++q) {
											ChildDTO child8 = new ChildDTO();
											child8 = list.get(q);
											int num8 = getTeamCount(child8.getStr_sp());
											BigDecimal bda8 = new BigDecimal(getTeamMaxSP(child8.getStr_sp()));
											BigDecimal bdi8 = new BigDecimal(getTeamMinSP(child8.getStr_sp()));
											for (int r = q + 1; r < list.size(); ++r) {
												ChildDTO child9 = new ChildDTO();
												child9 = list.get(r);
												int num9 = getTeamCount(child9.getStr_sp());
												BigDecimal bda9 = new BigDecimal(getTeamMaxSP(child9.getStr_sp()));
												BigDecimal bdi9 = new BigDecimal(getTeamMinSP(child9.getStr_sp()));
												for (int s = r + 1; s < list.size(); ++s) {
													ChildDTO child10 = new ChildDTO();
													child10 = list.get(s);
													int num10 = getTeamCount(child10.getStr_sp());
													BigDecimal bda10 = new BigDecimal(getTeamMaxSP(child10.getStr_sp()));
													BigDecimal bdi10 = new BigDecimal(getTeamMinSP(child10.getStr_sp()));
													for (int t = s + 1; t < list.size(); ++t) {
														ChildDTO child11 = new ChildDTO();
														child11 = list.get(t);
														int num11 = getTeamCount(child11.getStr_sp());
														BigDecimal bda11 = new BigDecimal(getTeamMaxSP(child11.getStr_sp()));
														BigDecimal bdi11 = new BigDecimal(getTeamMinSP(child11.getStr_sp()));
														for (int u = t + 1; u < list.size(); ++u) {
															ChildDTO child12 = new ChildDTO();
															child12 = list.get(u);
															int num12 = getTeamCount(child12.getStr_sp());
															BigDecimal bda12 = new BigDecimal(getTeamMaxSP(child12.getStr_sp()));
															BigDecimal bdi12 = new BigDecimal(getTeamMinSP(child12.getStr_sp()));
															c += num1 * num2 * num3 * num4 * num5 * num6 * num7 * num8 * num9 * num10 * num11 * num12;
															bdmaxM = bdmaxM.add(bda1.multiply(bda2).multiply(bda3).multiply(bda4).multiply(bda5).multiply(bda6).multiply(bda7).multiply(bda8)
																	.multiply(bda9).multiply(bda10).multiply(bda11).multiply(bda12));
															BigDecimal bdtemp = bdi1.multiply(bdi2).multiply(bdi3).multiply(bdi4).multiply(bdi5).multiply(bdi6).multiply(bdi7).multiply(bdi8)
																	.multiply(bdi9).multiply(bdi10).multiply(bdi11).multiply(bdi12);
															if (isFirst) {
																BigDecimal i0 = new BigDecimal(getTeamMinSP(list.get(0).getStr_sp()));
																BigDecimal i1 = new BigDecimal(getTeamMinSP(list.get(1).getStr_sp()));
																BigDecimal i2 = new BigDecimal(getTeamMinSP(list.get(2).getStr_sp()));
																BigDecimal i3 = new BigDecimal(getTeamMinSP(list.get(3).getStr_sp()));
																BigDecimal i4 = new BigDecimal(getTeamMinSP(list.get(4).getStr_sp()));
																BigDecimal i5 = new BigDecimal(getTeamMinSP(list.get(5).getStr_sp()));
																BigDecimal i6 = new BigDecimal(getTeamMinSP(list.get(6).getStr_sp()));
																BigDecimal i7 = new BigDecimal(getTeamMinSP(list.get(7).getStr_sp()));
																BigDecimal i8 = new BigDecimal(getTeamMinSP(list.get(8).getStr_sp()));
																BigDecimal i9 = new BigDecimal(getTeamMinSP(list.get(9).getStr_sp()));
																BigDecimal i10 = new BigDecimal(getTeamMinSP(list.get(10).getStr_sp()));
																BigDecimal i11 = new BigDecimal(getTeamMinSP(list.get(11).getStr_sp()));
																bdminM = i0.multiply(i1).multiply(i2).multiply(i3).multiply(i4).multiply(i5).multiply(i6).multiply(i7).multiply(i8).multiply(i9)
																		.multiply(i10).multiply(i11);
																isFirst = false;
															}
															if (bdtemp.compareTo(bdminM) == -1 || bdtemp.compareTo(bdminM) == 0) {
																bdminM = bdtemp;
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		} else if (num == 13) {
			boolean isFirst = true;
			for (int i = 0; i < list.size(); ++i) {
				ChildDTO child = new ChildDTO();
				child = list.get(i);
				int num1 = getTeamCount(child.getStr_sp());
				BigDecimal bda1 = new BigDecimal(getTeamMaxSP(child.getStr_sp()));
				BigDecimal bdi1 = new BigDecimal(getTeamMinSP(child.getStr_sp()));
				for (int j = i + 1; j < list.size(); ++j) {
					ChildDTO child2 = new ChildDTO();
					child2 = list.get(j);
					int num2 = getTeamCount(child2.getStr_sp());
					BigDecimal bda2 = new BigDecimal(getTeamMaxSP(child2.getStr_sp()));
					BigDecimal bdi2 = new BigDecimal(getTeamMinSP(child2.getStr_sp()));
					for (int k = j + 1; k < list.size(); ++k) {
						ChildDTO child3 = new ChildDTO();
						child3 = list.get(k);
						int num3 = getTeamCount(child3.getStr_sp());
						BigDecimal bda3 = new BigDecimal(getTeamMaxSP(child3.getStr_sp()));
						BigDecimal bdi3 = new BigDecimal(getTeamMinSP(child3.getStr_sp()));
						for (int m = k + 1; m < list.size(); ++m) {
							ChildDTO child4 = new ChildDTO();
							child4 = list.get(m);
							int num4 = getTeamCount(child4.getStr_sp());
							BigDecimal bda4 = new BigDecimal(getTeamMaxSP(child4.getStr_sp()));
							BigDecimal bdi4 = new BigDecimal(getTeamMinSP(child4.getStr_sp()));
							for (int n = m + 1; n < list.size(); ++n) {
								ChildDTO child5 = new ChildDTO();
								child5 = list.get(n);
								int num5 = getTeamCount(child5.getStr_sp());
								BigDecimal bda5 = new BigDecimal(getTeamMaxSP(child5.getStr_sp()));
								BigDecimal bdi5 = new BigDecimal(getTeamMinSP(child5.getStr_sp()));
								for (int o = n + 1; o < list.size(); ++o) {
									ChildDTO child6 = new ChildDTO();
									child6 = list.get(o);
									int num6 = getTeamCount(child6.getStr_sp());
									BigDecimal bda6 = new BigDecimal(getTeamMaxSP(child6.getStr_sp()));
									BigDecimal bdi6 = new BigDecimal(getTeamMinSP(child6.getStr_sp()));
									for (int p = o + 1; p < list.size(); ++p) {
										ChildDTO child7 = new ChildDTO();
										child7 = list.get(p);
										int num7 = getTeamCount(child7.getStr_sp());
										BigDecimal bda7 = new BigDecimal(getTeamMaxSP(child7.getStr_sp()));
										BigDecimal bdi7 = new BigDecimal(getTeamMinSP(child7.getStr_sp()));
										for (int q = p + 1; q < list.size(); ++q) {
											ChildDTO child8 = new ChildDTO();
											child8 = list.get(q);
											int num8 = getTeamCount(child8.getStr_sp());
											BigDecimal bda8 = new BigDecimal(getTeamMaxSP(child8.getStr_sp()));
											BigDecimal bdi8 = new BigDecimal(getTeamMinSP(child8.getStr_sp()));
											for (int r = q + 1; r < list.size(); ++r) {
												ChildDTO child9 = new ChildDTO();
												child9 = list.get(r);
												int num9 = getTeamCount(child9.getStr_sp());
												BigDecimal bda9 = new BigDecimal(getTeamMaxSP(child9.getStr_sp()));
												BigDecimal bdi9 = new BigDecimal(getTeamMinSP(child9.getStr_sp()));
												for (int s = r + 1; s < list.size(); ++s) {
													ChildDTO child10 = new ChildDTO();
													child10 = list.get(s);
													int num10 = getTeamCount(child10.getStr_sp());
													BigDecimal bda10 = new BigDecimal(getTeamMaxSP(child10.getStr_sp()));
													BigDecimal bdi10 = new BigDecimal(getTeamMinSP(child10.getStr_sp()));
													for (int t = s + 1; t < list.size(); ++t) {
														ChildDTO child11 = new ChildDTO();
														child11 = list.get(t);
														int num11 = getTeamCount(child11.getStr_sp());
														BigDecimal bda11 = new BigDecimal(getTeamMaxSP(child11.getStr_sp()));
														BigDecimal bdi11 = new BigDecimal(getTeamMinSP(child11.getStr_sp()));
														for (int u = t + 1; u < list.size(); ++u) {
															ChildDTO child12 = new ChildDTO();
															child12 = list.get(u);
															int num12 = getTeamCount(child12.getStr_sp());
															BigDecimal bda12 = new BigDecimal(getTeamMaxSP(child12.getStr_sp()));
															BigDecimal bdi12 = new BigDecimal(getTeamMinSP(child12.getStr_sp()));
															for (int v = u + 1; v < list.size(); ++v) {
																ChildDTO child13 = new ChildDTO();
																child13 = list.get(v);
																int num13 = getTeamCount(child13.getStr_sp());
																BigDecimal bda13 = new BigDecimal(getTeamMaxSP(child13.getStr_sp()));
																BigDecimal bdi13 = new BigDecimal(getTeamMinSP(child13.getStr_sp()));
																c += num1 * num2 * num3 * num4 * num5 * num6 * num7 * num8 * num9 * num10 * num11 * num12 * num13;
																bdmaxM = bdmaxM.add(bda1.multiply(bda2).multiply(bda3).multiply(bda4).multiply(bda5).multiply(bda6).multiply(bda7).multiply(bda8)
																		.multiply(bda9).multiply(bda10).multiply(bda11).multiply(bda12).multiply(bda13));
																BigDecimal bdtemp = bdi1.multiply(bdi2).multiply(bdi3).multiply(bdi4).multiply(bdi5).multiply(bdi6).multiply(bdi7).multiply(bdi8)
																		.multiply(bdi9).multiply(bdi10).multiply(bdi11).multiply(bdi12).multiply(bdi13);
																if (isFirst) {
																	BigDecimal i0 = new BigDecimal(getTeamMinSP(list.get(0).getStr_sp()));
																	BigDecimal i1 = new BigDecimal(getTeamMinSP(list.get(1).getStr_sp()));
																	BigDecimal i2 = new BigDecimal(getTeamMinSP(list.get(2).getStr_sp()));
																	BigDecimal i3 = new BigDecimal(getTeamMinSP(list.get(3).getStr_sp()));
																	BigDecimal i4 = new BigDecimal(getTeamMinSP(list.get(4).getStr_sp()));
																	BigDecimal i5 = new BigDecimal(getTeamMinSP(list.get(5).getStr_sp()));
																	BigDecimal i6 = new BigDecimal(getTeamMinSP(list.get(6).getStr_sp()));
																	BigDecimal i7 = new BigDecimal(getTeamMinSP(list.get(7).getStr_sp()));
																	BigDecimal i8 = new BigDecimal(getTeamMinSP(list.get(8).getStr_sp()));
																	BigDecimal i9 = new BigDecimal(getTeamMinSP(list.get(9).getStr_sp()));
																	BigDecimal i10 = new BigDecimal(getTeamMinSP(list.get(10).getStr_sp()));
																	BigDecimal i11 = new BigDecimal(getTeamMinSP(list.get(11).getStr_sp()));
																	BigDecimal i12 = new BigDecimal(getTeamMinSP(list.get(12).getStr_sp()));
																	bdminM = i0.multiply(i1).multiply(i2).multiply(i3).multiply(i4).multiply(i5).multiply(i6).multiply(i7).multiply(i8).multiply(i9)
																			.multiply(i10).multiply(i11).multiply(i12);
																	isFirst = false;
																}
																if (bdtemp.compareTo(bdminM) == -1 || bdtemp.compareTo(bdminM) == 0) {
																	bdminM = bdtemp;
																}
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		} else if (num == 14) {
			boolean isFirst = true;
			for (int i = 0; i < list.size(); ++i) {
				ChildDTO child = new ChildDTO();
				child = list.get(i);
				int num1 = getTeamCount(child.getStr_sp());
				BigDecimal bda1 = new BigDecimal(getTeamMaxSP(child.getStr_sp()));
				BigDecimal bdi1 = new BigDecimal(getTeamMinSP(child.getStr_sp()));
				for (int j = i + 1; j < list.size(); ++j) {
					ChildDTO child2 = new ChildDTO();
					child2 = list.get(j);
					int num2 = getTeamCount(child2.getStr_sp());
					BigDecimal bda2 = new BigDecimal(getTeamMaxSP(child2.getStr_sp()));
					BigDecimal bdi2 = new BigDecimal(getTeamMinSP(child2.getStr_sp()));
					for (int k = j + 1; k < list.size(); ++k) {
						ChildDTO child3 = new ChildDTO();
						child3 = list.get(k);
						int num3 = getTeamCount(child3.getStr_sp());
						BigDecimal bda3 = new BigDecimal(getTeamMaxSP(child3.getStr_sp()));
						BigDecimal bdi3 = new BigDecimal(getTeamMinSP(child3.getStr_sp()));
						for (int m = k + 1; m < list.size(); ++m) {
							ChildDTO child4 = new ChildDTO();
							child4 = list.get(m);
							int num4 = getTeamCount(child4.getStr_sp());
							BigDecimal bda4 = new BigDecimal(getTeamMaxSP(child4.getStr_sp()));
							BigDecimal bdi4 = new BigDecimal(getTeamMinSP(child4.getStr_sp()));
							for (int n = m + 1; n < list.size(); ++n) {
								ChildDTO child5 = new ChildDTO();
								child5 = list.get(n);
								int num5 = getTeamCount(child5.getStr_sp());
								BigDecimal bda5 = new BigDecimal(getTeamMaxSP(child5.getStr_sp()));
								BigDecimal bdi5 = new BigDecimal(getTeamMinSP(child5.getStr_sp()));
								for (int o = n + 1; o < list.size(); ++o) {
									ChildDTO child6 = new ChildDTO();
									child6 = list.get(o);
									int num6 = getTeamCount(child6.getStr_sp());
									BigDecimal bda6 = new BigDecimal(getTeamMaxSP(child6.getStr_sp()));
									BigDecimal bdi6 = new BigDecimal(getTeamMinSP(child6.getStr_sp()));
									for (int p = o + 1; p < list.size(); ++p) {
										ChildDTO child7 = new ChildDTO();
										child7 = list.get(p);
										int num7 = getTeamCount(child7.getStr_sp());
										BigDecimal bda7 = new BigDecimal(getTeamMaxSP(child7.getStr_sp()));
										BigDecimal bdi7 = new BigDecimal(getTeamMinSP(child7.getStr_sp()));
										for (int q = p + 1; q < list.size(); ++q) {
											ChildDTO child8 = new ChildDTO();
											child8 = list.get(q);
											int num8 = getTeamCount(child8.getStr_sp());
											BigDecimal bda8 = new BigDecimal(getTeamMaxSP(child8.getStr_sp()));
											BigDecimal bdi8 = new BigDecimal(getTeamMinSP(child8.getStr_sp()));
											for (int r = q + 1; r < list.size(); ++r) {
												ChildDTO child9 = new ChildDTO();
												child9 = list.get(r);
												int num9 = getTeamCount(child9.getStr_sp());
												BigDecimal bda9 = new BigDecimal(getTeamMaxSP(child9.getStr_sp()));
												BigDecimal bdi9 = new BigDecimal(getTeamMinSP(child9.getStr_sp()));
												for (int s = r + 1; s < list.size(); ++s) {
													ChildDTO child10 = new ChildDTO();
													child10 = list.get(s);
													int num10 = getTeamCount(child10.getStr_sp());
													BigDecimal bda10 = new BigDecimal(getTeamMaxSP(child10.getStr_sp()));
													BigDecimal bdi10 = new BigDecimal(getTeamMinSP(child10.getStr_sp()));
													for (int t = s + 1; t < list.size(); ++t) {
														ChildDTO child11 = new ChildDTO();
														child11 = list.get(t);
														int num11 = getTeamCount(child11.getStr_sp());
														BigDecimal bda11 = new BigDecimal(getTeamMaxSP(child11.getStr_sp()));
														BigDecimal bdi11 = new BigDecimal(getTeamMinSP(child11.getStr_sp()));
														for (int u = t + 1; u < list.size(); ++u) {
															ChildDTO child12 = new ChildDTO();
															child12 = list.get(u);
															int num12 = getTeamCount(child12.getStr_sp());
															BigDecimal bda12 = new BigDecimal(getTeamMaxSP(child12.getStr_sp()));
															BigDecimal bdi12 = new BigDecimal(getTeamMinSP(child12.getStr_sp()));
															for (int v = u + 1; v < list.size(); ++v) {
																ChildDTO child13 = new ChildDTO();
																child13 = list.get(v);
																int num13 = getTeamCount(child13.getStr_sp());
																BigDecimal bda13 = new BigDecimal(getTeamMaxSP(child13.getStr_sp()));
																BigDecimal bdi13 = new BigDecimal(getTeamMinSP(child13.getStr_sp()));
																for (int w = v + 1; w < list.size(); ++w) {
																	ChildDTO child14 = new ChildDTO();
																	child14 = list.get(w);
																	int num14 = getTeamCount(child14.getStr_sp());
																	BigDecimal bda14 = new BigDecimal(getTeamMaxSP(child14.getStr_sp()));
																	BigDecimal bdi14 = new BigDecimal(getTeamMinSP(child14.getStr_sp()));
																	c += num1 * num2 * num3 * num4 * num5 * num6 * num7 * num8 * num9 * num10 * num11 * num12 * num13 * num14;

																	bdmaxM = bdmaxM.add(bda1.multiply(bda2).multiply(bda3).multiply(bda4).multiply(bda5).multiply(bda6).multiply(bda7).multiply(bda8)
																			.multiply(bda9).multiply(bda10).multiply(bda11).multiply(bda12).multiply(bda13).multiply(bda14));
																	BigDecimal bdtemp = bdi1.multiply(bdi2).multiply(bdi3).multiply(bdi4).multiply(bdi5).multiply(bdi6).multiply(bdi7).multiply(bdi8)
																			.multiply(bdi9).multiply(bdi10).multiply(bdi11).multiply(bdi12).multiply(bdi13).multiply(bdi14);
																	if (isFirst) {
																		BigDecimal i0 = new BigDecimal(getTeamMinSP(list.get(0).getStr_sp()));
																		BigDecimal i1 = new BigDecimal(getTeamMinSP(list.get(1).getStr_sp()));
																		BigDecimal i2 = new BigDecimal(getTeamMinSP(list.get(2).getStr_sp()));
																		BigDecimal i3 = new BigDecimal(getTeamMinSP(list.get(3).getStr_sp()));
																		BigDecimal i4 = new BigDecimal(getTeamMinSP(list.get(4).getStr_sp()));
																		BigDecimal i5 = new BigDecimal(getTeamMinSP(list.get(5).getStr_sp()));
																		BigDecimal i6 = new BigDecimal(getTeamMinSP(list.get(6).getStr_sp()));
																		BigDecimal i7 = new BigDecimal(getTeamMinSP(list.get(7).getStr_sp()));
																		BigDecimal i8 = new BigDecimal(getTeamMinSP(list.get(8).getStr_sp()));
																		BigDecimal i9 = new BigDecimal(getTeamMinSP(list.get(9).getStr_sp()));
																		BigDecimal i10 = new BigDecimal(getTeamMinSP(list.get(10).getStr_sp()));
																		BigDecimal i11 = new BigDecimal(getTeamMinSP(list.get(11).getStr_sp()));
																		BigDecimal i12 = new BigDecimal(getTeamMinSP(list.get(12).getStr_sp()));
																		BigDecimal i13 = new BigDecimal(getTeamMinSP(list.get(13).getStr_sp()));

																		bdminM = i0.multiply(i1).multiply(i2).multiply(i3).multiply(i4).multiply(i5).multiply(i6).multiply(i7).multiply(i8)
																				.multiply(i9).multiply(i10).multiply(i11).multiply(i12).multiply(i13);
																		isFirst = false;
																	}
																	if (bdtemp.compareTo(bdminM) == -1 || bdtemp.compareTo(bdminM) == 0) {
																		bdminM = bdtemp;
																	}
																}
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		} else if (num == 15) {
			boolean isFirst = true;
			int h = list.size();
			for (int i = 0; i < h; ++i) {
				ChildDTO child = new ChildDTO();
				child = list.get(i);
				int num1 = getTeamCount(child.getStr_sp());
				BigDecimal bda1 = new BigDecimal(getTeamMaxSP(child.getStr_sp()));
				BigDecimal bdi1 = new BigDecimal(getTeamMinSP(child.getStr_sp()));
				for (int j = i + 1; j < h; ++j) {
					ChildDTO child2 = new ChildDTO();
					child2 = list.get(j);
					int num2 = getTeamCount(child2.getStr_sp());
					BigDecimal bda2 = new BigDecimal(getTeamMaxSP(child2.getStr_sp()));
					BigDecimal bdi2 = new BigDecimal(getTeamMinSP(child2.getStr_sp()));
					for (int k = j + 1; k < h; ++k) {
						ChildDTO child3 = new ChildDTO();
						child3 = list.get(k);
						int num3 = getTeamCount(child3.getStr_sp());
						BigDecimal bda3 = new BigDecimal(getTeamMaxSP(child3.getStr_sp()));
						BigDecimal bdi3 = new BigDecimal(getTeamMinSP(child3.getStr_sp()));
						for (int m = k + 1; m < h; ++m) {
							ChildDTO child4 = new ChildDTO();
							child4 = list.get(m);
							int num4 = getTeamCount(child4.getStr_sp());
							BigDecimal bda4 = new BigDecimal(getTeamMaxSP(child4.getStr_sp()));
							BigDecimal bdi4 = new BigDecimal(getTeamMinSP(child4.getStr_sp()));
							for (int n = m + 1; n < h; ++n) {
								ChildDTO child5 = new ChildDTO();
								child5 = list.get(n);
								int num5 = getTeamCount(child5.getStr_sp());
								BigDecimal bda5 = new BigDecimal(getTeamMaxSP(child5.getStr_sp()));
								BigDecimal bdi5 = new BigDecimal(getTeamMinSP(child5.getStr_sp()));
								for (int o = n + 1; o < h; ++o) {
									ChildDTO child6 = new ChildDTO();
									child6 = list.get(o);
									int num6 = getTeamCount(child6.getStr_sp());
									BigDecimal bda6 = new BigDecimal(getTeamMaxSP(child6.getStr_sp()));
									BigDecimal bdi6 = new BigDecimal(getTeamMinSP(child6.getStr_sp()));
									for (int p = o + 1; p < h; ++p) {
										ChildDTO child7 = new ChildDTO();
										child7 = list.get(p);
										int num7 = getTeamCount(child7.getStr_sp());
										BigDecimal bda7 = new BigDecimal(getTeamMaxSP(child7.getStr_sp()));
										BigDecimal bdi7 = new BigDecimal(getTeamMinSP(child7.getStr_sp()));
										for (int q = p + 1; q < h; ++q) {
											ChildDTO child8 = new ChildDTO();
											child8 = list.get(q);
											int num8 = getTeamCount(child8.getStr_sp());
											BigDecimal bda8 = new BigDecimal(getTeamMaxSP(child8.getStr_sp()));
											BigDecimal bdi8 = new BigDecimal(getTeamMinSP(child8.getStr_sp()));
											for (int r = q + 1; r < h; ++r) {
												ChildDTO child9 = new ChildDTO();
												child9 = list.get(r);
												int num9 = getTeamCount(child9.getStr_sp());
												BigDecimal bda9 = new BigDecimal(getTeamMaxSP(child9.getStr_sp()));
												BigDecimal bdi9 = new BigDecimal(getTeamMinSP(child9.getStr_sp()));
												for (int s = r + 1; s < h; ++s) {
													ChildDTO child10 = new ChildDTO();
													child10 = list.get(s);
													int num10 = getTeamCount(child10.getStr_sp());
													BigDecimal bda10 = new BigDecimal(getTeamMaxSP(child10.getStr_sp()));
													BigDecimal bdi10 = new BigDecimal(getTeamMinSP(child10.getStr_sp()));
													for (int t = s + 1; t < h; ++t) {
														ChildDTO child11 = new ChildDTO();
														child11 = list.get(t);
														int num11 = getTeamCount(child11.getStr_sp());
														BigDecimal bda11 = new BigDecimal(getTeamMaxSP(child11.getStr_sp()));
														BigDecimal bdi11 = new BigDecimal(getTeamMinSP(child11.getStr_sp()));
														for (int u = t + 1; u < h; ++u) {
															ChildDTO child12 = new ChildDTO();
															child12 = list.get(u);
															int num12 = getTeamCount(child12.getStr_sp());
															BigDecimal bda12 = new BigDecimal(getTeamMaxSP(child12.getStr_sp()));
															BigDecimal bdi12 = new BigDecimal(getTeamMinSP(child12.getStr_sp()));
															for (int v = u + 1; v < h; ++v) {
																ChildDTO child13 = new ChildDTO();
																child13 = list.get(v);
																int num13 = getTeamCount(child13.getStr_sp());
																BigDecimal bda13 = new BigDecimal(getTeamMaxSP(child13.getStr_sp()));
																BigDecimal bdi13 = new BigDecimal(getTeamMinSP(child13.getStr_sp()));
																for (int w = v + 1; w < h; ++w) {
																	ChildDTO child14 = new ChildDTO();
																	child14 = list.get(w);
																	int num14 = getTeamCount(child14.getStr_sp());
																	BigDecimal bda14 = new BigDecimal(getTeamMaxSP(child14.getStr_sp()));
																	BigDecimal bdi14 = new BigDecimal(getTeamMinSP(child14.getStr_sp()));
																	for (int x = w + 1; x < h; ++x) {
																		ChildDTO child15 = new ChildDTO();
																		child15 = list.get(x);
																		int num15 = getTeamCount(child15.getStr_sp());
																		BigDecimal bda15 = new BigDecimal(getTeamMaxSP(child15.getStr_sp()));
																		BigDecimal bdi15 = new BigDecimal(getTeamMinSP(child15.getStr_sp()));
																		c += num1 * num2 * num3 * num4 * num5 * num6 * num7 * num8 * num9 * num10 * num11 * num12 * num13 * num14 * num15;

																		bdmaxM = bdmaxM.add(bda1.multiply(bda2).multiply(bda3).multiply(bda4).multiply(bda5).multiply(bda6).multiply(bda7)
																				.multiply(bda8).multiply(bda9).multiply(bda10).multiply(bda11).multiply(bda12).multiply(bda13).multiply(bda14)
																				.multiply(bda15));
																		// Log.e("util15",
																		// "bdmaxM= "
																		// +
																		// bdmaxM);
																		BigDecimal bdtemp = bdi1.multiply(bdi2).multiply(bdi3).multiply(bdi4).multiply(bdi5).multiply(bdi6).multiply(bdi7)
																				.multiply(bdi8).multiply(bdi9).multiply(bdi10).multiply(bdi11).multiply(bdi12).multiply(bdi13).multiply(bdi14)
																				.multiply(bdi15);
																		// Log.i("util15",
																		// "bdtemp= "
																		// +
																		// bdtemp);
																		if (isFirst) {
																			BigDecimal i0 = new BigDecimal(getTeamMinSP(list.get(0).getStr_sp()));
																			BigDecimal i1 = new BigDecimal(getTeamMinSP(list.get(1).getStr_sp()));
																			BigDecimal i2 = new BigDecimal(getTeamMinSP(list.get(2).getStr_sp()));
																			BigDecimal i3 = new BigDecimal(getTeamMinSP(list.get(3).getStr_sp()));
																			BigDecimal i4 = new BigDecimal(getTeamMinSP(list.get(4).getStr_sp()));
																			BigDecimal i5 = new BigDecimal(getTeamMinSP(list.get(5).getStr_sp()));
																			BigDecimal i6 = new BigDecimal(getTeamMinSP(list.get(6).getStr_sp()));
																			BigDecimal i7 = new BigDecimal(getTeamMinSP(list.get(7).getStr_sp()));
																			BigDecimal i8 = new BigDecimal(getTeamMinSP(list.get(8).getStr_sp()));
																			BigDecimal i9 = new BigDecimal(getTeamMinSP(list.get(9).getStr_sp()));
																			BigDecimal i10 = new BigDecimal(getTeamMinSP(list.get(10).getStr_sp()));
																			BigDecimal i11 = new BigDecimal(getTeamMinSP(list.get(11).getStr_sp()));
																			BigDecimal i12 = new BigDecimal(getTeamMinSP(list.get(12).getStr_sp()));
																			BigDecimal i13 = new BigDecimal(getTeamMinSP(list.get(13).getStr_sp()));
																			BigDecimal i14 = new BigDecimal(getTeamMinSP(list.get(14).getStr_sp()));
																			bdminM = i0.multiply(i1).multiply(i2).multiply(i3).multiply(i4).multiply(i5).multiply(i6).multiply(i7).multiply(i8)
																					.multiply(i9).multiply(i10).multiply(i11).multiply(i12).multiply(i13).multiply(i14);
																			isFirst = false;
																			// Log.i("util15",
																			// "isFirst= "
																			// +
																			// isFirst);
																		}
																		if (bdtemp.compareTo(bdminM) == -1 || bdtemp.compareTo(bdminM) == 0) {
																			bdminM = bdtemp;
																			// Log.e("util15",
																			// "bdminM= "
																			// +
																			// bdminM);
																		}
																	}
																}
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}

		}
		result = c + "|" + bdminM + "|" + bdmaxM;
		// Log.v("util getMatchCount", "result= " + result);
		return result;

	}

}
